import HttpUtils from '../HttpUtils/HttpUtils';
// 获取当前时间戳
var timestamp = Date.parse(new Date()) / 1000;
Page({
	...HttpUtils.func,
	data: {
		folderCode: 0,
		djtvColumnList: []
	},
	onLoad(params) {
		var folderCode = params.folderCode;
		this.setData({
			"folderCode": folderCode
		});
		this.loadDjtvColumnList(folderCode);

	},
	loadDjtvColumnList: function(parentId) {
		var newUrl = getApp().globalData.dangjianUrl + "/content/relativeFolderQuery";
		var params = {};
		params["pageIndex"] = "1";
		params["pageItems"] = "1000";
		params["code"] = parentId + '';
		params["siteCode"] = getApp().globalData.siteCode + "";
		params = JSON.stringify(params);

		this.httpGet(newUrl, params, "党建电视子栏目加载失败").then(
			(respData) => {
				var result = respData.data.result.code;
				if (1 == result) {
					var folders = respData.data.folders.folder;
					this.setData({
						"djtvColumnList": folders
					});
				} else {
          this.showPageMsg("alert", respData.data.result.description)
				}
			}
		);
	}
});
